package com.ruitu.health_2.ui.adapter;

import android.content.Context;
import android.text.TextUtils;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.ruitu.arad.Arad;
import com.ruitu.arad.base.base_list.ListBaseAdapter;
import com.ruitu.arad.base.base_list.SuperViewHolder;
import com.ruitu.health_2.R;
import com.ruitu.router_module.bean.product.ArtMan;

// 横向的艺人adapter
public class HorizonArtManListAdapter extends ListBaseAdapter<ArtMan> {

    public HorizonArtManListAdapter(Context context) {
        super(context);
    }

    @Override
    public int getLayoutId() {
        return R.layout.item_com_art_man_list;
    }

    @Override
    public void onBindItemHolder(SuperViewHolder holder, int position) {
        ImageView iv_header = holder.getView(R.id.iv_header);
        TextView tv_name = holder.getView(R.id.tv_name);
        TextView tv_info = holder.getView(R.id.tv_info);

        ArtMan man = mDataList.get(position);
        tv_name.setText(man.getName());
        tv_info.setText(TextUtils.isEmpty(man.getIntro()) ? "暂无标签" : man.getIntro());

        Glide.with(mContext).load(man.getAvaterUrl()).apply(Arad.opts_circle).into(iv_header);
    }
}
